﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.ServiceModel;
using Dtl;

namespace DMSClient
{
    public partial class CienteWS : Form
    {
        
        
        
        public CienteWS()
        {
            InitializeComponent();
        }

        private void CienteWS_Load(object sender, EventArgs e)
        {
            WSHttpBinding httpBinding = new WSHttpBinding();
            httpBinding.MaxReceivedMessageSize = 2147483647;
            httpBinding.MaxBufferPoolSize = 2147483647;

            EndpointAddress address = new EndpointAddress("http://localhost:4872/IVisit.svc");

            ServiceReferenceVisit.IVisitClient cliente = new ServiceReferenceVisit.IVisitClient(httpBinding, address);
            String fechaIni = "2010-12-01";
            String fechaFin = "2011-03-01";
            ServiceReferenceVisit.Visit[] listaVisit = cliente.getVisitReport("rabie", DateTime.Parse(fechaIni), DateTime.Parse(fechaFin));

            foreach (ServiceReferenceVisit.Visit vis in listaVisit) 
            {
                dataGridView1.Rows.Add(vis.CdVisitInstance, vis.CdRegion, vis.CdStore, vis.CdUser);
            }



        }
    }
}
